<?php
namespace app\common\validate;

use think\Validate;

class Role extends Validate
{
    protected $rule = [
        'id' => 'require|number',
        'role_name' => 'require|max:100',
        'password' => 'require|max:100',
        'captcha|验证码' => 'require|captcha',
        'username' => 'require|min:1|max:250',
        'nick_name' => 'require|min:1|max:250',
        'status' => 'require|in:0,1,2',
        'face_img' => 'require|min:1|max:250',
        'mobile' => 'require|min:1|max:250',
        'email' => 'require|min:1|max:250',
        'description' => 'min:1|max:250',
        'page'  =>  'require|gt:0|number',
        'limit' =>  'require|gt:0|number',
    ];

    protected $scene = [
        'create' => ['role_name','status','description'],
        'update' => ['id','username','nick_name','gender','face_img','mobile','email','description'],
        'login' => ['username', 'password', 'captcha'],
        'delete' => ['id'],
        'backendList'=>['page','limit']
    ];
}
